#pragma once
#include "boost/shared_ptr.hpp"

class ILayer;

namespace StackUtils
{
	enum e_Status 
	{ 
		E_SUCCESS, 
		E_FAILURE,
	};

	void init_layer(boost::shared_ptr<ILayer>&);
}

class CPacket;
class IProtocol;

class ProtocolEncode 
{
public:
	ProtocolEncode(CPacket& p);

	void operator()(boost::shared_ptr<IProtocol>& protocol);
	void operator()(std::pair<const std::string, boost::shared_ptr<IProtocol> >& protocol);

private:
	CPacket& packet;
};

class ProtocolDecode 
{
public:
	ProtocolDecode(CPacket& p);

	void operator()(boost::shared_ptr<IProtocol>& protocol);
	void operator()(std::pair<const std::string, boost::shared_ptr<IProtocol> >& protocol);

private:
	CPacket& packet;
};

class LayerComparer
{
public:
	LayerComparer(const std::string& name);

	bool operator()(const boost::shared_ptr<ILayer>& layer);

private:
	std::string layer_name;
};

class ProtocolComparer
{
public:
	ProtocolComparer(const std::string& name);

	bool operator()(const boost::shared_ptr<IProtocol>& protocol);
	bool operator()(const std::pair<std::string, boost::shared_ptr<IProtocol> >& map_protocol);

private:
	std::string protocol_name;
};
